home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2917 < prev    next >
Encoding:
Text File  |  1996-08-05  |  912 b   |  41 lines

  1. Newsgroups: comp.lang.c
  2. Path: ritz.mordor.com!news
  3. From: benjamin@ritz.mordor.com (Joseph Thomas)
  4. Subject: Is it possible to #include <#defined or -D 'ed macro>?
  5. X-Newsreader: Gnus v5.1
  6. X-Nntp-Posting-User: benjamin
  7. Sender: benjamin@ritz.mordor.com
  8. Organization: Mordor International
  9. Message-ID: <5rbuntgqp0.fsf@ritz.mordor.com>
  10. X-Nntp-Posting-Host: ritz.mordor.com
  11. Date: Wed, 24 Jan 1996 22:42:35 GMT
  12.  
  13. Does anyone know a way of having an include statement that can include
  14. a file, based on a -D <MACRO_NAME> flag passed to the compiler, to
  15. give the effect of:
  16.  
  17.  
  18. #include <SOURCE>
  19.  
  20.  
  21.  
  22. cc -D SOURCE=source_a.h
  23.  
  24. includes source_a.h
  25.  
  26. and 
  27.  
  28. cc -D SOURCE=source_b.h
  29.  
  30. includes source_b.h, (this doesn't seem to work with the xlc compiler)
  31.  
  32. or at least explain a method whereby I can conditionally include one
  33. of a few different headers at various spots in my source, based on a
  34. -D passed to the compiler?
  35.  
  36. TIA,
  37.     Joe
  38.  
  39.  
  40.  
  41.